package com.itheima;

/**
 * 2025/5/16 19:36
 */
public class Test {
    public static void main(String[] args) {
        test(new Socket() {
            @Override
            public void supply() {
                System.out.println("supply");
            }

            @Override
            public void turnOn() {
                System.out.println("turnOn");
            }

            @Override
            public void turnOff() {
                System.out.println("turnOff");
            }
        });
    }

    public static void test(Socket socket){
        socket.turnOn();
        socket.supply();
        socket.turnOff();
    }

}
